# Contributor: Newbyte <newbie13xd@gmail.com>
# Maintainer: Newbyte <newbie13xd@gmail.com>
pkgname=py3-html-sanitizer
pkgver=2.3
pkgrel=1
pkgdesc="Allowlist-based and opinionated HTML sanitizer"
url="https://github.com/matthiask/html-sanitizer"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-lxml
	python3
	"
makedepends="
	py3-beautifulsoup4
	py3-gpep517
	py3-hatchling
	py3-installer
	py3-wheel
	"
checkdepends="
	py3-tox
	"
subpackages="$pkgname-pyc"
source="html-sanitizer-$pkgver.tar.gz::https://github.com/matthiask/html-sanitizer/archive/$pkgver.tar.gz"
builddir="$srcdir/html-sanitizer-$pkgver"
options="!check" # fail with new beautifulsoup in diff

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	tox -e tests --sitepackages
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
}

sha512sums="
d4ddd7a38413d89778b8f4bf950fe8566fe535433ab68007010a03bcd2a07589d902d28b24d96349638e955fc1c60a4473275fa1175a8ecc829688455996a0ee  html-sanitizer-2.3.tar.gz
"
